<template>
	<view>
		<view v-if="skyContent">
			<slot></slot>
		</view>
		<view class="sunui-template" :style="{height:skyDesc.height==undefined?'100%':skyDesc.height,backgroundColor:skyDesc.bgColor==undefined?'#eee':skyDesc.bgColor}" v-else>
			<view>
				<view class="sunui-sky-loading">
					<!-- 可自由DIY -->
					<view style="width: 100%;text-align: center;margin-bottom: 10%;"><text class="sunui-iconfont" :class="[skyDesc.Desc?skyDesc.iconName:'']" :style="{color:skyDesc.iconColor==undefined?'#000':skyDesc.iconColor}" ></text></view>
					<view style="text-align: center;" :style="{color:skyDesc.iconColor==undefined?'#000':skyDesc.iconColor}">{{skyDesc.Desc}}</view>
				</view>
				<button type="button" class="sunui-sky-rest-loading" hover-class="sunui-sky-btn-hover" :hidden="!skyDesc.isLoad" @click.stop="resetLoading">重新加载</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "sunui-template",
		props: {
			skyContent: {
				type: Boolean,
				value: true
			},
			skyDesc: {
				type: Object
			}
		},
		methods: {
			
			resetLoading: function(e) {
				this.$emit('resetLoading', this.skyType);
			}
		}
	}
</script>

<style lang="scss">
	@import "../../static/font/iconfont.css";
	.sunui-sky-btn-hover {
		opacity: .8;
	}
	.icon-kong,.icon-cuowuhttp{
		color: #000;
		font-size: 3em;
	}

	.sunui-template {
		width: 100%;
		font-size: .8em;
		position: absolute;
		background-color: #eee;
		margin: auto;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		z-index: 666;
		.sunui-sky-rest-loading {
			color: #fff;
			font-size: .8em;
			height: 60upx;
			line-height: 60upx;
			background-color: #DD5145;
			border-radius: 100upx;
			margin: 0;
			margin-top: 10%;
		}
	}
</style>
